package com.bsh.controller;

import com.bsh.entity.Result;
import com.bsh.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Api(tags = "用户管理")
@RequestMapping("/user")
public class UserController {
    @Resource
    private UserService userService;

    @ApiOperation("填充数据")
    @PostMapping("/addUserData")
    public Result addUserData(){
        userService.addUserData();
        return Result.success();
    }

    @ApiOperation("多线程修改数据")
    @PostMapping("/updateData/{password}/{userId}")
    public Result updateData(@PathVariable("password") String password,
                             @PathVariable("userId") String userId){
        userService.updateData(userId,password);
        return Result.success();
    }

}
